﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BLL.Services.Authors;
using BLL.Services.Books;
using BLL.Services.Categories;

namespace Web.Models
{
    public class BookModel
    {
        public BookModel()
        {
            Categories = new List<CategoryModel>();
        }

        public IEnumerable<CategoryModel> Categories { get; set; }

        public CurrentBookModel CurrentBook { get; set; }

        public class CategoryModel
        {
            public CategoryModel(Category category)
            {
                Id = category.CategoryId;
                Name = category.Name;
            }
            public int Id { get; set; }

            public string Name { get; set; }
        }

        public class CurrentBookModel
        {
            public CurrentBookModel(Book book)
            {
                Avatar = book.Avatar;
                Id = book.BookId;
                Name = book.Name;
                ShortDescription = book.ShortContent;
                FileName = book.FileName;
             
            }
            public int Id { get; set; }

            public string Name { get; set; }

            public string Avatar { get; set; }

            public string ShortDescription { get; set; }

            public Author[] Authors { get; set; }

            public string FileName { get; set; }

            public bool IsCanRate { get; set; }

            public int Rating { get; set; }
        }
    }
}